#include "PrecompiledHeader.h"
#include "System.h"
#include "App.h"

#include "ConfigurationDialog.h"
#include "ModalPopups.h"
#include "Panels/ConfigurationPanels.h"

#include <wx/filepicker.h>

using namespace Panels;
using namespace pxSizerFlags;

// ----------------------------------------------------------------------------
Dialogs::CDVDSettingsDialog::CDVDSettingsDialog( wxWindow* parent )
	: BaseApplicableDialog( parent, _("CDVD Settings") )
{
	m_selpan = new Panels::CDVDSettingsPanel( this );

	*this += m_selpan		| StdExpand();
	AddOkCancel();

	Connect( wxID_OK,		wxEVT_COMMAND_BUTTON_CLICKED,			wxCommandEventHandler(CDVDSettingsDialog::OnOk_Click) );
}

bool Dialogs::CDVDSettingsDialog::Show( bool show )
{
	if( show && m_selpan )
		m_selpan->OnShown();

	return _parent::Show( show );
}

int Dialogs::CDVDSettingsDialog::ShowModal()
{
	if( m_selpan )
		m_selpan->OnShown();
		
	return _parent::ShowModal();
}

void Dialogs::CDVDSettingsDialog::OnOk_Click( wxCommandEvent& evt )
{
	if( m_ApplyState.ApplyAll() )
	{
		Close();
		evt.Skip();
	}
}
